// 本地存储模块
export function setItem (key, value) {
  if (typeof value === 'object') {
    localStorage.setItem(key, JSON.stringify(value))
  } else {
    localStorage.setItem(key, value)
  }
}

export function getItem (key) {
  try {
    return JSON.parse(localStorage.getItem(key))
  } catch (e) {
    // console.error(e)
    return localStorage.getItem(key)
  }
}
export function removeItem (key) {
  localStorage.removeItem(key)
}
